package com.Java.train.business.controller;

import com.Java.train.business.entity.DTO.SeatSellDTO;
import com.Java.train.business.req.SeatSellReq;
import com.Java.train.business.service.SeatSellService;
import com.Java.train.common.response.CommonResp;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/seat-sell")
public class SeatSellController {
    @Resource
    SeatSellService seatSellService;

    @GetMapping("/query")
    public CommonResp<List<SeatSellDTO>> query(@Valid SeatSellReq seatSellReq){
        List<SeatSellDTO> list = seatSellService.query(seatSellReq);
        return new CommonResp<List<SeatSellDTO>>(list);
    }
}
